class MyThread implements Runnable{
    static int sum = 0;
    public MyThread(int a, int b) {
        for (int i = a; i <= b; i++) {
            sum += i;
        }
    }

    public  void run() {
        getNumber();
    }

    public  static int getNumber(){
        return sum;
    }
}
public class Main {
    public static void main(String[] args)throws InterruptedException {
        MyThread thread1 = new MyThread(1, 25);
        MyThread thread2 = new MyThread(26, 50);
        MyThread thread3 = new MyThread(51, 75);
        MyThread thread4 = new MyThread(76, 100);
        Thread t1 = new Thread(thread1);
        Thread t2 = new Thread(thread2);
        Thread t3 = new Thread(thread3);
        Thread t4 = new Thread(thread4);
        t1.start();
        t2.start();
        t3.start();
        t4.start();
        t1.join();
        t2.join();
        t3.join();
        t4.join();
        System.out.println(MyThread.getNumber());
    }
}
